#include"RBTree.h"

void test01()
{
	RBTree<int, int>rbt;;
	AVLTree<int, int>avlt;

	srand(time(0));

	int j = 1000;

	int begin1 = clock();

	for (int i = 0; i < j; i++)
	{
		rbt.Insert(make_pair(i, 1));
	}

	int end1 = clock();

	int begin2 = clock();

	for (int i = 0; i < j; i++)
	{
		avlt.Insert(make_pair(i, 1));
	}

	int end2 = clock();
	cout << "RBTree Insert: " << end1-begin1 << endl;
	cout << "AVLTree Insert: " << end2 - begin2 << endl;

	cout << "RBTree Height ";
	rbt.Height();
	cout << endl;

	cout << "AVLTree Height " << avlt.Height() << endl;

}

int main()
{
	RBTree<int, int>rbt;;
	int a[] = { 2,7,9,1,0,};

	for (auto &e : a)
	{	
		cout << e << endl;
		rbt.Insert(make_pair(e, e));
	}

	rbt.InOrder();
	rbt.Height();
	rbt.Size();

	/*test01();*/

}